package com.xmy.cultivate.mapper;

import com.xmy.cultivate.entity.EnrollStageTime;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;

/**
 * <p>
 * 阶段时间表 Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2024-09-04
 */
public interface EnrollStageTimeMapper extends BaseMapper<EnrollStageTime> {
    @Select("SELECT COUNT(*) FROM enroll_stage_time WHERE ('${startDate}' BETWEEN start_date AND end_date) OR ('${endDate}' BETWEEN start_date AND end_date) OR (start_date BETWEEN '${startDate}' AND '${endDate}') OR (end_date BETWEEN '${startDate}' AND '${endDate}')")
    Integer countByDate(@Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);

}
